@import "@/styles/variables";

.root {
  width: 100%;
}

.input_wrap {
  position: relative;
}

.input {
  box-sizing: border-box;
  padding: 1.25rem 0.75rem;
  width: 100%;

  transition: 0.2s ease;
  -webkit-appearance: none;

  font-size: 0.875rem;
  color: $color-text;

  border: 1px solid $color-gray ;
  border-radius: 0.5rem;

  &::placeholder {
    color: rgba(#ffffff, 0.6);
  }

  &:disabled {
    opacity: 0.6;
  }



  &:focus:not(.input_error) {
    outline: none;
    border: 1px solid $color-gray-500;
    & + .underline::before {
      opacity: 1;
    }

    & ~ .password_toggle svg {
      color: $color-gray-500;
    }
  }
}

.input_error {
  border: 2px solid $color-red;
}

.error_wrap {
  display: block;

  text-align: left;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.175s;
}

.error_wrap_active {
  max-height: 18px;
}

.error {
  font-size: 12px;
  line-height: 1.2;
  color: var(--clr-red);

  display: block;
  padding-top: 4px;
}

.password_toggle {
  position: absolute;
  top: 1.25rem;
  right: 0.75rem;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  svg {
    width: 16px;
    height: 16px;
    color: rgba(#000000, 0.5);
  }
}

.label {
  font-size: 0.875rem;
  opacity: 0.6;
  color: $color-text;

  display: block;
  margin-bottom: 0.125rem;
}
